{include file="public/header" /}
<span class="layui-breadcrumb">
  <a href="{:url('Blog/index')}?nav=blog-bloglist">产品</a>
  
  <a><cite>seo编辑-{$one['Product_Number']}</cite></a>
</span>
<style> 
.layui-form-label{width:200px;}
.layui-form-item .layui-input-block{margin-left:230px;}
</style>
<div class="layui-fluid">
    <div class="layui-card">
    	<form class="layui-form" id="product_form" action="" style='padding:10px'>
        <div>英文</div>
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
              <textarea id="title" name="title" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['title'];}?></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
              <textarea id="keyword" name="keyword" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['keyword'];}?></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <textarea id="desc" name="desc" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['desc'];}?></textarea>
            </div>
        </div>
        <hr>

        <div>中文</div>
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
              <textarea id="zh_title" name="zh_title" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['zh_title'];}?></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
              <textarea id="zh_keword" name="zh_keword" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['zh_keword'];}?></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <textarea id="zh_desc" name="zh_desc" style="width:100%;height:80px;"><?php if(!empty($detail)){echo $detail['zh_desc'];}?></textarea>
            </div>
        </div>
        
        <div class="layui-form-item">
          <label class="layui-form-label"></label>
          <div class="layui-input-block">
             <?php if(!empty($detail)){?>
             <button type='button' class="layui-btn layui-btn-normal" onclick="tijiao({$one['id']})">确定</button>
             <?php }else{ ?>
             <button type='button' class="layui-btn layui-btn-normal" onclick="tijiao({$one['id']})">确定</button>
             <?php } ?>
          </div>
        </div>

		</form>
    </div>
</div>
{include file="/public/footer" /}

<script>

 function tijiao(id){
    layer.load();
    var title=$.trim($("textarea[name='title']").val());
    var zh_title=$.trim($("textarea[name='zh_title']").val());
    var zh_keword=$.trim($("textarea[name='zh_keword']").val());
    var keyword=$.trim($("textarea[name='keyword']").val());
    var zh_desc=$.trim($("textarea[name='zh_desc']").val());
    var desc=$.trim($("textarea[name='desc']").val());

    if(title==''&&zh_title==''){
      layer.closeAll('loading');
      layer.msg('中英文标题必填');
      return false;
    }

    $.post("{:url('Product/shibie_seo')}",{id:id,title:title,zh_title:zh_title,zh_keword:zh_keword,keyword:keyword,zh_desc:zh_desc,desc:desc},function(res){
      if(res.status=='0'){
        layer.closeAll('loading');
        layer.msg(res.msg);
      }
      if(res.status=='1'){
        layer.msg(res.msg,{time: 500 },
        function(){
          layer.closeAll();
          location.href=location.href;
        });
      }
    })
 }
</script>
